package junit;

import java.util.Arrays;
import junit.framework.TestCase;
import pass.Primes;

public class PrimesTest extends TestCase{
	
	private Primes primes;
	
	//@Before  
	public void setUp() throws Exception {
		super.setUp();
		primes = new Primes();
	}

	//@After
	public void tearDown() throws Exception {
		super.tearDown();
	}

	//@Test
	public void testPrimes() {
		
		this.assertTrue("n = 5",Arrays.equals(new int[]{2,3,5},primes.primes(5)));


		this.assertTrue("n = 30",Arrays.equals(new int[]{2,3,5,7,11,13,17,19,23,29},primes.primes(30)));

		
		this.assertTrue("n = 2",Arrays.equals(new int[]{2},primes.primes(2)));

		
		this.assertTrue("n = 1",Arrays.equals(new int[]{},primes.primes(1)));

		
		this.assertTrue("n = 0",Arrays.equals(new int[]{},primes.primes(0)));
		
		this.assertTrue("n est negatif",Arrays.equals(new int[]{},primes.primes(-1)));
		
		

	}

}
